package com.hospital.controller;


import com.hospital.dao.SitDao;
import com.hospital.domain.Sit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/sit")
public class SitController {

    @Autowired
    SitDao sitDao;

    @GetMapping("/selectAll")
    public List<Sit> selectAll(){
        return sitDao.selectAllSit();
    }

    @PostMapping("/addSit")
    public int addSit(@RequestBody Sit sit){
        System.out.println(sit);
        return sitDao.addSit(sit);
    }
}
